In [2]:
import numpy as np 
import pandas as pd
import seaborn as sns
from datetime import datetime
import matplotlib.pyplot as plt 
import os
import plotly.graph_objects as go
import plotly.express as px
In [4]:
#Loading Data
lvl = pd.read_csv("chennai_reservoir_levels.csv")
rain = pd.read_csv("chennai_reservoir_rainfall.csv")
In [5]:
fig = px.line(lvl, x='Date', y='POONDI')
fig.show();
In [6]:
fig = px.line(lvl, x='Date', y='CHOLAVARAM')
fig.show();
In [7]:
fig = px.line(lvl, x='Date', y='REDHILLS')
fig.show();
In [8]:
fig = px.line(lvl, x='Date', y='CHEMBARAMBAKKAM')
fig.show();

Water level data has a seasonality that can be seen in these curves. Although this Trend is keep on decreasing and currently, Only Poondi Reservoir has some water left. All other three reservoirs are running empty. On 2014 December approx, there's a sudden growth in water level that is very unnatural. Maybe supplied from some other region. Downfall in water level is significant in 2019 Feb-July. Evidence of water shortage can be noticed in all four reservoir between a period of 2017-2018 year transition. Also the dry period generally ends at the starting of December just after the dry period which generally occurs in october.

In [9]:
fig, (ax1, ax2) = plt.subplots(1, 2,figsize=(15,5))
ax1.plot(rain.REDHILLS, 'r')
ax2.plot(rain.CHOLAVARAM, 'b')
plt.show();
#Water reservoir level in million cubic feet (mcf), y axis
In [10]:
fig, (ax1,ax2) = plt.subplots(1,2, figsize=(15,5))
ax1.plot(rain.CHOLAVARAM)
ax2.plot(rain.POONDI,'g')
plt.show();
#Water reservoir level in million cubic feet (mcf), y axis
In [11]:
fig ,(ax1,ax2) = plt.subplots(1,2,figsize=(15,5))
ax1.plot(rain.REDHILLS,'r')
ax2.plot(rain.CHEMBARAMBAKKAM);
#Water reservoir level in million cubic feet (mcf), y axis
In [12]:
fig, (ax1,ax2) = plt.subplots(1, 2, figsize=(15,5))
ax1.plot(rain.CHEMBARAMBAKKAM ,'b') 
ax2.plot(rain.POONDI )
plt.show;
#Water reservoir level in million cubic feet (mcf), y axis
In [13]:
corr = lvl.corr()
corr.style.background_gradient(cmap='coolwarm')
Out[13]:
POONDI CHOLAVARAM REDHILLS CHEMBARAMBAKKAM
POONDI 1 0.833647 0.804117 0.879381
CHOLAVARAM 0.833647 1 0.757776 0.812085
REDHILLS 0.804117 0.757776 1 0.867192
CHEMBARAMBAKKAM 0.879381 0.812085 0.867192 1
In [14]:
corr = rain.corr()
corr.style.background_gradient(cmap='coolwarm')
Out[14]:
POONDI CHOLAVARAM REDHILLS CHEMBARAMBAKKAM
POONDI 1 0.716779 0.708773 0.673569
CHOLAVARAM 0.716779 1 0.901169 0.741132
REDHILLS 0.708773 0.901169 1 0.780106
CHEMBARAMBAKKAM 0.673569 0.741132 0.780106 1

Seasonality in graphs can be explained using this evidence. Signs of heavy coorelation is observed in this coorelation matrix.

In [15]:
rain.Date = pd.to_datetime(rain.Date)
rain.set_index('Date', inplace=True)
In [16]:
rain.plot(figsize=(20,10), linewidth=3, fontsize=15)
plt.xlabel('Year', fontsize=15)
plt.ylabel('Rain Level', fontsize=15);

Above bar chart describes the water availity during the last 15 years in 4 different reservoirs located in the cities of chennai.

In [17]:
rain.total = rain.POONDI + rain.CHOLAVARAM + rain.REDHILLS + rain.CHEMBARAMBAKKAM
rain.total.plot(figsize=(20,10), linewidth=3, fontsize=15)
plt.xlabel('Year', fontsize=15)
plt.ylabel('Rain Level', fontsize=15);
C:\Users\Pragati mehra\Anaconda3\lib\site-packages\ipykernel_launcher.py:1: UserWarning:

Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access

Total water availibility is very low in 2019. Perodic cycle is disturbed in current phase. Significant downfall in total water level has been observed since 2015 and it keeps on decreasing till 2019.